<template>
  <section>
    <table-board v-if="board.type === 'table'" :baord="board" />
    <form-board v-if="board.type === 'form'" :board="board" />
  </section>
</template>

<script>
import { Base64 } from "js-base64";
import TableBoard from "./TableBoard.vue";
import FormBoard from "./FormBoard.vue";

export default {
  name: "ResourceBoard",
  components: {
    FormBoard,
    TableBoard
  },
  data() {
    return {
      board: {}
    };
  },
  created() {
    let { board, dataId } = this.$route.params;
    board = JSON.parse(Base64.decode(board));
    this.board = { ...board, dataId };
  }
};
</script>
